<%--
  Created by IntelliJ IDEA.
  User: Uros
  Date: 31.10.2013
  Time: 19:03
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
<head>
    <r:require module="dashboard"/>
    <r:require module="fancybox"/>
    <r:require module="datepicker"/>
</head>
<body>

<section class="stats" id="provider-open">
    <header>
        <h1><g:message code="orderlist.openorders"/></h1>
    </header>

        <div class="span11 error" style="display: none;">
            <div class="alert alert-error">
                <a class="close">×</a>
                <strong>Error</strong> Change a few things up and try submitting again.
            </div>
        </div>

    <g:each in="${openOrders}" var="order">
        <g:render template="/provider/templates/order" model="${[order:order, open:true]}"/>
    </g:each>
</section>

<section class="stats" id="provider-applied">
    <header>
        <h1><g:message code="orderlist.appliedto"/></h1>
    </header>
    <div class="span11 error" style="display: none;">
        <div class="alert alert-error">
            <a class="close">×</a>
            <strong>Error</strong> Change a few things up and try submitting again.
        </div>
    </div>
    <g:each in="${appliedTo}" var="application">
        <g:render template="/provider/templates/application" model="${[app:application]}"/>
    </g:each>
</section>

<div id="applyForm" style="display:none;">
    <div class="row-fluid">
        <div class="span12">
            <form class="form-horizontal" data-href="#">
                <div class="control-group">
                    <label class="control-label" for="provider-price"><g:message code="your.price"/></label>
                    <div class="controls">
                        <input name="price" type="text" data-value="100" class="input-small" id="provider-price" value="100">
                        <p class="help-block"><g:message code="price.shown.customer"/>.</p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="provider-get"><g:message code="you.get"/></label>
                    <div class="controls">
                        <input data-value="${100-100*(bankfee+usfee)}" value="${100-100*(bankfee+usfee)}" data-bankfee="${bankfee}" data-usfee="${usfee}" disabled type="text" class="input-small" id="provider-get">
                        <p class="help-block"><g:message code="fees.info" args="${[bankfee*100, usfee*100]}"/>.</p>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="provider-get"><g:message code="can.start"/></label>
                    <div class="controls">
                        <div class="input-append date" id="dp3" data-date="${g.formatDate(date: new Date())}" data-date-format="${g.message(code: 'default.datepicker.format')}">
                            <input name="canStart" class="input-small" type="text" value="${g.formatDate(date: new Date())}" readonly="">
                            <span class="add-on"><i class="icon-calendar"></i></span>
                        </div>
                    </div>
                    <label class="control-label" for="provider-get"><g:message code="can.finish"/></label>
                    <div class="controls">
                        <div class="input-append date" id="dp4" data-date="${g.formatDate(date: new Date()+1)}" data-date-format="${g.message(code: 'default.datepicker.format')}">
                            <input name="canFinish" class="input-small" type="text" value="${g.formatDate(date: new Date()+1)}" readonly="">
                            <span class="add-on"><i class="icon-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="form-actions">
        <button type="submit" class="btn btn-primary"><g:message code="apply"/></button>
    </div>
</div>


</body>
</html>